package game;
public class BonusFactory {

	public BonusFactory(){
		
	}

	/*
	 * Returns a new specified Bonus object
	 */
	@SuppressWarnings("unchecked")
	public AbstractBonus getBonusInstance(String panelType) {
		Class<AbstractBonus> myClass = null;
		try {
			myClass = (Class<AbstractBonus>) Class.forName(panelType);
		} catch (ClassNotFoundException e1) {
			e1.printStackTrace();
		}
		AbstractBonus bonus = null;
		try {
			bonus = myClass.newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return bonus;
	}
}
